from jieba.analyse.textrank import TextRank

# 获取案例文本内容
demo_file_path = "demo.txt"
content = open(demo_file_path, "rb").read()

# 创建TextRank对象
text_rank = TextRank()

# 设置窗口大小（默认是5）
text_rank.span = 6

# 获取关键词top10
keywords = text_rank.textrank(content, topK=10)
print(', '.join(keywords))
